#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int num = 0;
	int qiuyu = 0;
	scanf("%d", &num);
	while (num!=0)
	{
		qiuyu = num % 10;
		num /= 10;
		printf("%d ", qiuyu);
	}
	return 0;
}